from django.shortcuts import render,HttpResponse
from django.http import JsonResponse
import json
from autoserver import settings
from django.conf import settings,global_settings

# Create your views here.
def asset(request):
    # return HttpResponse("success")
    if request.method == 'POST':
        print(request.POST)
        print(request.body) #原始数据
        ret = json.loads(request.body.decode('utf-8'))
        print(ret,type(ret))
        return HttpResponse('接收到')
    if request.method == 'GET':
        host_list = ['c1.com','c2.com']
        return JsonResponse(host_list,safe=False)